<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
           .box4{
           position: relative;
           margin: 0 auto;
           width: 100px;
           height: 100px;
           border-radius: 10px;
           background-color: gold;
       }
       .box4>div{
           position:absolute;
           top: -14px;
           right:-14px;
           width: 28px;
           height: 28px;
           background-color: red;
           color: #ffffff;
           text-align: center;
           line-height: 28px;
           border-radius: 50%;

       }
    </style>
</head>
<body>
    <div class="box4">
        <div>5</div>
    </div>
</body>
</html>